import request from "@/utils/request"
/*行政区划*/
export function getHisRegion(data) {
  return request({
    url: "/basic/hisRegion/tree",
    method: "get",
    params: data
  })
}

export function addHisRegion(data) {
  return request({
    url: `/basic/hisRegion`,
    method: "post",
    params: data
  })
}

export function updateHisRegion(data) {
  return request({
    url: `/basic/hisRegion`,
    method: "put",
    params: data
  })
}

export function deleteRegion(id) {
  return request({
    url: `/basic/hisRegion/${id}`,
    method: "delete"
  })
}

export function initRegion(id) {
  return request({
    url: `/basic/hisRegion/init/${id}`,
    method: "delete"
  })
}

export function getHisRegionMessage(code) {
  return request({
    url: `/basic/hisRegion/msg/${code}`,
    method: "get"
  })
}

/* 行政区划懒加载 */
export function lazyRegion(data) {
  return request({
    url: `/basic/hisRegion/lazy`,
    method: "get",
    params: data
  })
}

export function lazyNodeRegion(code) {
  return request({
    url: `/basic/hisRegion/lazy/${code}`,
    method: "get"
  })
}

/*全国区划*/
export function getHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll/tree`,
    method: "get",
    params: data
  })
}

export function addHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll`,
    method: "post",
    params: data
  })
}

export function updateHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll`,
    method: "put",
    params: data
  })
}

export function deleteRegionAll(id) {
  return request({
    url: `/basic/hisRegionAll/${id}`,
    method: "delete"
  })
}

export function initRegionAll(id) {
  return request({
    url: `/basic/hisRegionAll/init/${id}`,
    method: "delete"
  })
}

export function getHisRegionAllMessage(code) {
  return request({
    url: `/basic/hisRegionAll/msg/${code}`,
    method: "get"
  })
}

/* 全国区划懒加载 */
export function lazyRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll/lazy`,
    method: "get",
    params: data
  })
}

export function lazyNodeRegionAll(code) {
  return request({
    url: `/basic/hisRegionAll/lazy/${code}`,
    method: "get"
  })
}
